package com.campus.service.impl;

import com.campus.dao.TeachingCallingDao;
import com.campus.dto.TeachingCalling;
import com.campus.service.CallingService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Slf4j
public class CallingServiceImpl implements CallingService {

    @Autowired
    private TeachingCallingDao teachingCallingDao;

    @Override
    public boolean addCalling(TeachingCalling calling) {
        return teachingCallingDao.addTeachingCalling(calling) > 0;
    }

    @Override
    public boolean deleteTeachingCallingById(int id) {
        return teachingCallingDao.deleteTeachingCallingById(id) > 0;
    }

    @Override
    public boolean updateTeachingCalling(TeachingCalling calling) {
        return teachingCallingDao.updateTeachingCalling(calling) > 0;
    }

    @Override
    public List<TeachingCalling> getAllCallings() {
        return teachingCallingDao.findAllCallings();
    }

}
